package com.wsjj.yjh.mapper;

import com.wsjj.yjh.bean.Employee;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface EmployeeMapper {

//    查询单条数据
    @Select("select * from employee where id = #{id}")
    Employee getEmpByID(int id);
//     查询全部数据
    @Select("select * from employee")
    List<Employee> getEmpList();
//    插入数据
    @Insert("insert into employee(last_name, gender, email) values (#{lastName},#{gender},#{email})")
    void insertEmp(Employee employee);
//    删除数据
    @Delete("delete from employee where id = #{id} ")
    void deleteEep(int id);
//    修改数据
    @Update("update employee set last_name=#{lastName}, gender=#{gender}, email=#{email} where id=#{id}")
    void updateEmp(Employee employee);
}
